//默认白色主题
:root {

}
//系统自动切换为深色时的主题
@media (prefers-color-scheme: dark) {
  :root {

  }
}
.padding-start{ padding-left: var(--space-width); }
.padding-start-half{ padding-left: var(--space-width-half); }
.padding-end{ padding-right: var(--space-width); }
.padding-end-half{ padding-right: var(--space-width-half); }
.margin-start{ margin-left: var(--space-width); }
.margin-start-half{ margin-left: var(--space-width-half); }
.margin-end{ margin-right: var(--space-width); }
.margin-end-half{ margin-right: var(--space-width-half); }
body {
  min-height: 100vh;
  background-image: var(--var-background-image);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
  //
  font-size: 14px;
}

main{
  max-width: 1200px;
  margin: 0 auto;
}
#page-qrcode {
  width: 120px;
  background: var(--light-background);
  position: fixed;
  left: calc((100% - 1200px) / 2 - 120px - var(--space-width));
  top: calc(156px + var(--space-width) * 2);
  min-height: 120px;
  border-radius: var(--radius-width);
  transition: top .3s;
  &.home {
    top: calc(146px + var(--space-width));
  }
  &.scroll {
    top: calc(82px + var(--space-width));
  }
  .qrcode {
    padding: 10px;
    img{width: 100px;}
  }
  .text {
    text-align: center;
    color: var(--color-medium);
    font-size: 10px;
    padding-bottom: 10px;
  }
}
header{
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--light-background);
  width: 1200px;
  margin: 0 auto;
  border-radius: calc(2 * var(--radius-width));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: width .3s;
  min-height: 80px;
  padding: 20px;
  main {
    position: relative;
    overflow: visible;
    .site-logo {
      img{ height: 40px; }
    }
    .site-name {
      font-size: 32px;
      line-height: 1;
    }
    .search-form {
      display: flex;
      flex-flow: row;
      border: solid 1px var(--border-color);
      border-radius: var(--radius-width);
      overflow: hidden;
      height: var(--button-height);
      transition: .3s;
      .input {
        input{ outline: none; border: none; width: 150px; height: 100%; transition: width .3s; padding: 0 0 0 var(--space-width);
          &:focus {
            width: 200px;
          }
        }
      }
      .btn {
        button{ border:none; background: transparent; height: 100%; width: var(--button-height); }
      }
      &:focus-within {
        border-color: var(--color-primary);
        box-shadow: 0 0 5px var(--color-primary);
      }
    }
    //菜单
    menu {
      margin: 0;
      padding: 0 20px;
      display: flex;
      flex-flow: row;
      dl, dd{margin: 0;padding: 0;}
      dl{
        position: relative;
        margin-right: var(--space-width);
        dt, dd{
          a{
            height: var(--button-height);
            display: flex;
            flex-flow: column;
            justify-content: center;
            min-width: 100px;
            transition: .3s;
            text-align: center;
            font-size: 16px;
            border-radius: var(--radius-width);
            color: var(--color-dark);
            &:hover {
              color: var(--color-dark);
              background: var(--border-color-light);
            }
            &.active{
              background: var(--color-primary);
              color: var(--color-primary-contrast);
            }
            &.more::before {
              content: "\f141";
              font-family: var(--fa-style-family, "Font Awesome 6");
            }
          }
        }
        dd{
          z-index: 999;
          height: 0;
          opacity: 0;
          position: absolute;
          background: var(--light-background);
          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
          left: 0;
          top: 50px;
          border-radius: 0 0 var(--radius-width) var(--radius-width);
          transition: .3s;
          overflow: hidden;
          &::before{
            content: '';
            width: 0;
            border: solid 5px transparent;
            border-bottom-color: var(--border-color);
            display: block;
            margin: 0 auto;
          }
          a{
            min-width: calc(100px - var(--space-width));
            height: auto;
            padding: var(--space-width);
            font-size: 1rem;
            margin: var(--space-width-half);
          }
        }
        &:hover {
          dt a {
            color: var(--color-dark);
            background: var(--border-color-light);
            &.more:before {
              content: '更多'
            }
          }
          dd{ height: auto; opacity: 1; top: var(--button-height); }
        }
      }
    }
  }
  &.top {
    width: 100%;
    border-radius: 0;
  }
}

footer{
  padding: 20px;
  background: var(--light-background);
  transition: width .3s;
  /*
  &.bottom{
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 0;
  }*/
}
.fixed-buttons {
  display: none;
  position: fixed;
  right: var(--space-width);
  bottom: var(--space-width);
  width: var(--button-height);
  background: var(--light-background);
  border: solid 1px var(--border-color);
  .btn {
    height: var(--button-height);
    display: flex;
    flex-flow: column;
    justify-content: center;
    text-align: center;
    border-bottom: solid 1px var(--border-color-light);
    transition: .3s;
    cursor: pointer;
    &:hover {
      background: var(--color-primary);
      color: var(--color-primary-contrast);
    }
    &:last-child{
      border-bottom: none;
    }
  }
}
//16:9轮播图
.index-swiper{
  width: 100%;
  border-radius: var(--radius-width);
  overflow: hidden;
  .inner {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%;
  }
  .swiper{width: 100%;height:100%;position: absolute;left: 0;top: 0;}
}
.panel-block{
  .title{margin-bottom: var(--space-width-half); margin-top: var(--space-width);}
}
.swiper-pagination {
  bottom: 20px!important;
}
.swiper-pagination .swiper-pagination-bullet{
  border: solid 1px var(--color-dark);
}
.swiper-pagination .swiper-pagination-bullet-active {
  width: 8px;
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.reading-bar{
  .percent{height: 2px;background: var(--color-primary);transition: width .3s;}
}
.main-wrap {
  padding: var(--space-width);
  main{
    display: flex;
    flex-flow: row;
    .container {
      flex: 1;
    }
    .aside{
      padding-left: var(--space-width);
      width: 30%;
      min-width: 320px;
    }
  }
}

//图片显示
.pic-4b3{
  position: relative;
  overflow: hidden;
  padding-top: 75%;
  background-position: center;
  background-size: cover;
  display: block;
  .wrap{
    transition: all .3s;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-flow: column;
    justify-content: center;
    background-position: center;
    background-size: cover;
    img{
      display: block;
      margin: 0 auto;
      max-width: 100%;
      height: auto;
    }
  }
  &.hover-zoom:hover{
    .wrap{transform: scale(1.1);}
  }
}
.pic-1b1{
  position: relative;
  overflow: hidden;
  padding-top: 100%;
  background-position: center;
  background-size: cover;
  display: block;
  .wrap{
    background-position: center;
    background-size: cover;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    img{
      display: block;
      width: 100%;
      height: 100%;
    }
  }
  &.circle{
    border-radius: 50%;
  }
}
//卡片列表
.cards{
  overflow: auto;
  padding: var(--space-width-half);
  display: grid;
  grid-gap: 0;
  gap: 0;
  grid-template-columns: repeat(auto-fill, minmax(calc(100%/2 - var(--space-width)), 1fr));
  .card{
    .preview{display: block;}
  }
  &.double-space{
    padding: var(--space-width);
    .card{
      margin: var(--space-width);
    }
  }
  &.one-cards{
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
  }
  &.three-columns{
    .card{width: calc(33.33% - var(--space-width));}
    &.double-space{
      .card{width: calc(33.33% - 2 * var(--space-width));}
    }
  }
}
//标
.badge{
  background: var(--color-base);
  color: var(--color-base-contrast);
  width: var(--button-height-small);
  height: var(--button-height-small);
  text-align: center;
  display: flex;
  flex-flow: column;
  justify-content: center;
  font-size: var(--font-size-small);
}
//列表
.list{
  .item{
    position: relative;
    padding: var(--space-width);
    display: flex;
    flex-flow: row;
    transition: .3s;
    .detail{flex: 1;}
    &:hover {
      background: var(--background);
    }
  }
  &.double-item-space{
    .item{
      padding: calc(2 * var(--space-width));
    }
  }
  &.linear-split{
    .item{
      transition: .3s;
      border-left: solid 1px transparent;
      &:hover {
        background: linear-gradient(to right, var(--background) 0%, transparent 100%);
        border-left-color: var(--color-primary);
      }
      &::after{
        position: absolute;
        content: '';
        display: block;
        height: 1px;
        bottom: 0;
        left: var(--space-width);
        width: calc(100% - 2 * var(--space-width));
        background: var(--border-color-light);
        background: linear-gradient(to left, var(--border-color-light) 0%, transparent 100%);
      }
      &:last-child::after{display: none;}
    }
    &.double-item-space{
      .item::after{
        left: calc(2 * var(--space-width));
        width: calc(100% - 4 * var(--space-width));
      }
    }
  }
}
//头像
$sizes: tiny, small, large, bigger, maximum;
.avatar{
  width: var(--button-height);
  height: var(--button-height);
  overflow: hidden;
  background: var(--background);
  border-radius: 50%;
  display: flex;
  flex-flow: column;
  justify-content: center;
  text-align: center;
  img{
    margin: 0 auto;
    width: var(--button-height);
    height: var(--button-height);
  }
  @each $size in $sizes{
    &.#{$size}{
      --button-height: var(--button-height-#{$size});
    }
  }
}
//分隔线
.divider{
  display: flex;
  white-space: nowrap;
  text-align: center;
  &::before, &::after{
    position: relative;
    content: '';
    display: inline-block;
    border-top: solid 1px var(--border-color);
    width: 50%;
    transform: translateY(50%);
  }
  &::before{margin-right: var(--space-width);}
  &::after{margin-left: var(--space-width);}
  &.mini{
    display: inline-flex;
    &::before, &::after{width: 30px;}
  }
}
//分页
.pagination{
  .page-item{
    display: inline-flex;
    flex-flow: column;
    justify-content: center;
    height: 32px;
    border: solid 1px transparent;
    background: var(--light-background);
    text-align: center;
    min-width: 32px;
    padding: 0 5px;
    border-radius: var(--radius-width);
    cursor: pointer;
    transition: 300ms;
    margin: 0 3px;
    line-height: 30px;
    &:hover, &.current{
      border-color: var(--color-primary);
      color: var(--color-primary);
      text-decoration: none;
    }
    &.current{
      background: var(--color-primary);
      color: var(--color-primary-contrast);
    }
    &.next::before, &.prev::before {
      font-family: var(--fa-style-family, "Font Awesome 6");
      content: "\f141";
    }
    &.prev:hover::before {
      border-color: transparent;
      content: "\f323";
    }
    &.next:hover::before {
      border-color: transparent;
      content: "\f324";
    }
  }
}

main.page-error {
  display: flex;
  flex-flow: column;
  justify-content: center;
  text-align: center;
  min-height: 500px;
  background: var(--light-background);
  border-radius: var(--radius-width);
  border: solid 1px var(--border-color-light);
}

//文章详情
.archive {
  line-height: 1.5;
  .title { font-size: var(--font-size-maximum);}
  .description {background: var(--border-color-light); padding: var(--space-width); color: var(--color-medium); }
  .detail{
    padding-top: calc(var(--space-width) * 2);
    img {max-width: 90%;display: block;margin: var(--space-width) auto;}
    /*
    h1, h2, h3, h4, h5 {
      border-left: solid 3px var(--color-primary);
      padding-left: var(--space-width);
      line-height: 1.2;
    }*/
  }
}
.ui.tag{
  transition: .3s;
}
.ui.tag:hover{
  opacity: .8;
}

.line-height-16px {line-height: 18px;}
.line-height-20px {line-height: 20px;}
.line-height-30px {line-height: 30px;}

.footer-links {
  .center {
    a{ display: inline-block; margin: var(--space-width-half);}
  }
}

//链接
.links {
  display: grid;
  grid-gap: var(--space-width);
  gap: var(--space-width);
  grid-template-columns: repeat(auto-fill, minmax(calc(100%/2 - var(--space-width)), 1fr));
  .item {
    border-radius: var(--radius-width);
    display: flex;
    flex-flow: row;
    background: var(--background);
    padding: var(--space-width);
    .detail{
      flex: 1;
    }
    &:hover {
      background: var(--border-color);
    }
  }
}
.ext-menu-toggle {display: none;}
//窗口宽度在1200px以内时
@media (max-width: 1200px) {
  main {max-width: 1000px;}
  header{
    width: 1000px;
  }
  .site-name {display: none;}
  header main .search-form .input input {
    width: 100px;
    &:focus {
      width: 120px;
    }
  }
  #page-qrcode{
    left: calc((100% - 1000px) / 2 - 120px - var(--space-width));
  }
}
//窗口宽度在1000px以内时
@media (max-width: 1000px) {
  main {max-width: 100%;}
  header{
    width: 100%;
    border-radius: 0;
    main menu{display: none!important;}
  }
  .header-prefix{display: none;}
  .site-name {display: flex;}
  header main .search-form .input input {
    width: 150px;
    &:focus {
      width: 200px;
    }
  }
}
//窗口宽度在1000px以内时
@media (max-width: 900px) {
  .ext-menu-toggle {display: flex;}
  .main-wrap {
    main{
      display: block;
      .aside{
        padding: 0;
        margin-top: var(--space-width);
        min-width: unset;
        width: 100%;
        .links {
          grid-template-columns: repeat(auto-fill, minmax(calc(100%/3 - var(--space-width)), 1fr));
        }
      }
    }
  }
  #page-qrcode{
    display: none;
  }
}
//窗口宽度在1000px以内时
@media (max-width: 640px) {
  .site-name {display: none;}
  header main {
    .menu-wrap {display: none;}
    .search-wrap {
      flex: 1;
      .search-form {
        display: flex;
        flex-flow: row;
        flex: 1;
        .input {flex: 1;
          input{width: 100%;}
        }
      }
    }
  }
  header main .search-form .input input {
    width: 120px;
    &:focus {
      width: 150px;
    }
  }
  .main-wrap {
    main{
      display: block;
      .aside{
        padding: 0;
        margin-top: var(--space-width);
        min-width: unset;
        width: 100%;
        .links {
          grid-template-columns: repeat(auto-fill, minmax(calc(100%/2 - var(--space-width)), 1fr));
        }
      }
    }
  }
  .recommend-view {
    display: block!important;
    .left-cards{
      width: 100%!important;
      padding: var(--space-width)!important;
      .cards {padding: 0!important;margin: 0;
        .card .title{margin-top: 0!important;}
      }
    }
  }
  .list {
    .item {
      padding: var(--space-width) !important;
      .item-preview {width: 30% !important; margin-right: 0;}
    }
  }
  .panel-block {
    .title{text-align: center;}
    svg {
      display: block;
      margin: var(--space-width) auto;
    }
  }
  .hot-view {
    padding: 0!important;
    grid-template-columns: repeat(auto-fill, minmax(calc(100% - var(--space-width)), 1fr));
    .card .title{margin-top: 0!important;}
  }

  .archive {
    padding: 0!important;
  }

  .prevnext {
    margin-top: var(--space-width);
    padding: 0!important;
    display: block!important;
    text-align: left!important;
  }
}